//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package location;

import com.google.gson.JsonObject;

public class DisplayObjectTimer {
  private final int StartSeconds;
  private int TicksLeft;
  private LogicTimer t;
  private final int startedTicks;

  public DisplayObjectTimer(int StartSeconds, int TicksLeft, int TicksNow) {
    this.StartSeconds = StartSeconds;
    this.TicksLeft = TicksLeft;
    this.startedTicks = TicksNow;
    this.t = new LogicTimer();
    this.t.startTimer(TicksLeft, TicksNow);
  }

  public int StartSeconds() {
    return this.StartSeconds;
  }

  public int getTicksLeft() {
    return this.TicksLeft;
  }

  public int getTicksWhenStart() {
    return this.startedTicks;
  }

  public int getRmainingSeconds(int ticksNow) {
    return this.t.getRemainingSeconds(ticksNow);
  }

  public void reset() {
    this.t.reset();
  }

  public JsonObject getAsJsonObject() {
    JsonObject jo = new JsonObject();
    jo.addProperty("StartSeconds", Integer.valueOf(this.StartSeconds));
    jo.addProperty("TicksLeft", Integer.valueOf(this.TicksLeft));
    return jo;
  }

  public String toString() {
    return "{ StartSeconds=" + this.StartSeconds + ", Subticks=" + this.t.getSubticks() + " }";
  }
}
